package edu.auctionmart

import static org.junit.Assert.*
import org.junit.*

class LocationIntegrationTests {

    void testLocation() {
		Location testLocation = new Location(name: "Russell Gillen", addressLine: "50 USM Street", zipCode: "04103", town: "Portland", state: "ME")
		
		//Location with errors won't save
		Location testLocation2 = new Location(name: "Russell Gillen", addressLine: "50 USM Street", zipCode: "041036", town: "Portland", state: "ME")
		
		testLocation.save()
		def locationShouldReturn = Location.get(testLocation.id)
		assertNotNull(locationShouldReturn)
		
		testLocation2.save()
		def locationShouldNotReturn = Location.get(testLocation2.id)
		assertNull(locationShouldNotReturn)
	}
}